package com.zhijian.medical.service;

import com.zhijian.medical.entity.po.PersonRole;
import com.zhijian.medical.entity.vo.request.PersonRoleSearchVo;
import com.zhijian.medical.entity.vo.response.PersonRoleVo;
import com.zhijian.medical.util.Page;

import java.util.List;

/**
 * 人员-角色关系表 业务处理层
 *
 * @author HCG
 * @version 1.0
 * @date 2022-01-21 14:32:50
 */
public interface PersonRoleService {

    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    PersonRole selectById(Long id);

    /**
     * 主键查询vo
     *
     * @param id
     * @return
     */
    PersonRoleVo selectVoById(Long id);

    /**
     * 按照主键删除
     *
     * @param id
     */
    void deleteById(Long id);

    /**
     * 根据人员id删除
     *
     * @param personId
     */
    void deleteByPersonId(Long personId);

    /**
     * 新增
     *
     * @param personRole
     * @return
     */
    Long insert(PersonRole personRole);

    /**
     * 更改
     *
     * @param personRole
     * @return
     */
    boolean update(PersonRole personRole);

    /**
     * 总数
     *
     * @param personRoleSearchVo
     * @return
     */
    Integer count(PersonRoleSearchVo personRoleSearchVo);

    /**
     * 列表
     *
     * @param personRoleSearchVo
     * @return
     */
    List<PersonRoleVo> selectList(PersonRoleSearchVo personRoleSearchVo);

    /**
     * 分页查询
     *
     * @param personRoleSearchVo
     * @return
     */
    Page<PersonRoleVo> selectPage(PersonRoleSearchVo personRoleSearchVo);

    /**
     * 根据人员id查询所有的角色id
     *
     * @param personId
     * @return
     */
    List<Long> selectRolesByPersonId(Long personId);
}